package cn.xval.ft.app.gen.params;

import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

public class FrontHostParams {
    @Data
    @Schema(description = "FrontHost新增请求参数")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class FrontHostCreateRequest {
        @NotNull
        @Schema(description = "前置机类型")
        private Integer frontType;
        @NotNull
        @Schema(description = "前置解析类型")
        private Integer resolveType;
        @NotNull
        @Schema(description = "协议")
        @Length(max = 20)
        private String protocol;
        @NotNull
        @Schema(description = "端口")
        private Long port;
        @NotNull
        @Schema(description = "前置机地址")
        @Length(max = 100)
        private String addr;
        @NotNull
        @Schema(description = "名称")
        @Length(max = 100)
        private String name;
    }
    @Data
    @Schema(description = "FrontHost 返回数据")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class FrontHostInfo {
        @Schema(description = "编码")
        private String id;
        @Schema(description = "名称")
        private String name;
        @Schema(description = "前置机类型")
        private Integer frontType;
        @Schema(description = "前置解析类型")
        private Integer resolveType;
        @Schema(description = "协议")
        private String protocol;
        @Schema(description = "前置机地址")
        private String addr;
        @Schema(description = "端口")
        private Long port;
    }
    @Data
    @Schema(description = "FrontHost更新请求参数")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class FrontHostModifyRequest {
        @NotNull
        @Schema(description = "编码")
        private String id;
        @NotNull
        @Schema(description = "名称")
        @Length(max = 100)
        private String name;
        @NotNull
        @Schema(description = "前置机地址")
        @Length(max = 100)
        private String addr;
        @NotNull
        @Schema(description = "协议")
        @Length(max = 20)
        private String protocol;
        @NotNull
        @Schema(description = "端口")
        private Long port;
        @NotNull
        @Schema(description = "前置解析类型")
        private Integer resolveType;
        @NotNull
        @Schema(description = "前置机类型")
        private Integer frontType;
    }
}